positioning code can error out gracefully.
Fix minor mem leak in Garmin USB position read case.
return wpt;
}
+ if (gps_errno) {
+ fatal(MYNAME ": Fatal error reading position.\n");
+ }
+
+ GPS_Pvt_Del(&pvt);
+
return NULL;
}
n = gusb_cmd_get(&pkt, sizeof(pkt));
if ( n < 0 ) {
-fprintf(stderr, "Eeek %d\n", n);
+ /*
+ * We (probably) used to have a GPS and it went away
+ * while we were speaking with it. Perhaps batteries
+ * died or it was unplugged or something.
+ */
+ gps_errno = PROTOCOL_ERROR;
return n;
}